<template>
  <z-paging ref="paging" @listChange="listChange" @query="queryData" min-delay="500" lower-threshold="300rpx">
    <template #loading>
      <cyPagingLoading></cyPagingLoading>
    </template>
    <!-- 顶部 -->
    <template #top>
      <slot name="top"></slot>
    </template>
    <template #bottom>
      <slot name="bottom"></slot>
    </template>
    <slot></slot>
  </z-paging>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import type { IHospitalItem } from '@/pages/index/types';
import cyPagingLoading from '../cy-paging-loading/cy-paging-loading.vue';

const emits = defineEmits(['initData', 'update:modelValue']);

const paging = ref(null);

function queryData(pageNo: number, pageSize: number) {
  emits('initData', pageNo, pageSize, paging);
}

function listChange(list: any) {
  emits('update:modelValue', list);
}
</script>

<style lang="scss" scoped></style>
